from typing import List

from pydantic import BaseModel


class PostBase(BaseModel):
    post_id: int
    title: str
    content: str


class Post(PostBase):
    author_id: int


class PostWithAuthor(PostBase):
    author: "User"


class UserBase(BaseModel):
    user_id: int
    email: str


class User(UserBase):
    pass


class UserWhitPosts(UserBase):
    posts: List["Post"]
